home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sun Solutions 2000 #2
/
Sun Solutions CD (Volume 2 2000)(Special Focus - Java Technologies)(Disc 1).ISO
/
products
/
Software
/
BostonBusinessComputing
/
bbc
/
dist
/
vtcpip.bsd
< prev
next >
Wrap
Text File
|
2000-02-11
|
4KB
|
149 lines
#
# Shell script for use with TCP/IP transport software
#
# If remote command is not found, set rem_cmnd to be the full path specification
# of your tcpip remote shell command, (i.e. /usr/foo/bin/rsh)
SET rem_cmnd = ""
IF ( rem_cmnd == "" ) THEN
IF ( -x "/usr/ucb/rsh" ) THEN
SET rem_cmnd = "/usr/ucb/rsh"
ELSE IF ( -x "/usr/bin/rcmd" ) THEN
SET rem_cmnd = "/usr/bin/rcmd"
ELSE IF ( -x "/usr/bin/remsh" ) THEN
SET rem_cmnd = "/usr/bin/remsh"
ELSE IF ( -x "/usr/bin/rsh" ) THEN
SET rem_cmnd = "/usr/bin/rsh"
ELSE IF ( -x "/usr/bsd/rsh" ) THEN
SET rem_cmnd = "/usr/bsd/rsh"
ELSE IF ( -x "/usr/bin/nsh" ) THEN
SET rem_cmnd = "/usr/bin/nsh"
ELSE IF ( -x "/usr/bin/resh" ) THEN
SET rem_cmnd = "/usr/bin/resh"
ELSE
ERROR "%VNET-E-NOREMCMND the remote shell command could not be found."
ERROR " Have your system administrator modify the vtcpip.bsd script file"
ERROR " or contact BBC Technical Support."
EXIT
ENDIF
ENDIF
IF ( q_confirm ) THEN
ERROR "%VNET-E-NOCONFIRM the CONFIRM qualifier is not currently supported for
this network"
EXIT
ENDIF
IF ( v_com == "rl" ) SET v_node=v_n1
IF ( v_os == "yes" ) THEN
IF ( v_com == "lp" ) SET vcom = "print"
IF ( v_com == "ls" ) THEN
SET vcom = "directory "
IF ( q_full ) SET vcom = vcom + "/full "
IF ( q_date ) SET vcom = vcom + "/date "
IF ( q_size ) SET vcom = vcom + "/size "
ENDIF
IF ( v_com == "mv" ) SET vcom = "rename"
IF ( v_com == "rm" ) SET vcom = "delete"
IF ( v_com == "ty" ) SET vcom = "type"
ELSE
SET vcom = v_com
IF ( vcom == "ls" ) SET vcom = "/bin/ls -l"
IF ( vcom == "mv" ) SET vcom = "/bin/mv"
IF ( vcom == "rm" ) SET vcom = "/bin/rm"
IF ( vcom == "ty" ) SET vcom = "/bin/cat"
ENDIF
IF ( v_com == "bt" ) THEN
# exit here to test for existence of vnet for vbackup
EXIT
# backup only works to unix systems
ELSE IF ( v_com == "ba" ) THEN
IF ( -n v_n1) THEN
SET vcom=rem_cmnd + " " + v_n1 + " '/bin/cat "
ELSE
SET vcom=rem_cmnd + " " + v_n2 + " '/bin/cat "
ENDIF
SET infile=v_d1+v_f1
IF (v_f2 == "-") THEN
SET outfile="'"
ELSE
SET outfile= " > " + v_d2 + v_f2 + "'"
ENDIF
SET netcom=vcom + infile + outfile
SHELL netcom
EXIT
ELSE IF ( v_com == "cp" ) THEN
IF ( ! q_replace ) THEN
ERROR "%VNET-E-NOREPL the REPLACE qualifier is not currently supported
for this network"
EXIT
ENDIF
SET vcom = "rcp"
IF ( -n v_n1) THEN
SET v_n1=v_n1 + ":"
ELSE
SET v_n2=v_n2 + ":"
ENDIF
SET infile=v_n1+v_d1+v_f1
SET outfile=v_n2+v_d2+v_f2
SET netcom=vcom+" '"+ infile +"' '"+ outfile+ "'"
SHELL netcom
EXIT
ELSE IF ( v_com == "ls" ) THEN
SET fn = "/tmp/v_" + pid
SET iocom = "' < /dev/null > " + fn
TRAP "/bin/rm -f "+fn 0 2
IF (v_f1 == "*") THEN
SET v_f1 = ""
ENDIF
SET inf = v_d1 + v_f1
SET netcom= rem_cmnd + " " + v_n1 + " '"+vcom+" "+ inf + iocom
SHELL netcom
set v_d1= v_n1 + "::" + (v_d1:vd)
IF ( -e fn) THEN
IF ( v_os == "yes" ) THEN
SHELL "/bin/cat " + fn + " ; /bin/rm " + fn
EXIT
ENDIF
ECHO "Directory " + v_d1 + "
"
IF ( v_f1 == "*.") THEN
SHELL "/bin/cat " + fn + " | tcfilter | grep -v '\.'; /bin/rm " + fn
EXIT
ENDIF
SHELL "/bin/cat " + fn + " | tcfilter ; /bin/rm " + fn
ENDIF
EXIT
ELSE IF ( v_com == "ma" ) THEN
SET netcom="/usr/lib/sendmail -t "+ recips + " " + text
SHELL netcom
EXIT
ELSE IF ( v_com == "mv" ) THEN
SET oldname= v_d1+v_f1+" "
SET newname= v_d2+v_f2+"'"
SET netcom= rem_cmnd + " " + v_n1+ " '" +vcom+" " + oldname + newname
SHELL netcom
EXIT
ELSE IF ( v_com == "rl" ) THEN
SET netcom = "rlogin " + v_node
SHELL netcom
EXIT
ELSE IF ( v_com == "rm" ) THEN
SET fn=" "+v_d1+v_f1+"'"
SET netcom = rem_cmnd + " " + v_n1 + " '"+vcom+ fn
SHELL netcom
EXIT
ELSE IF ( v_com == "sn" ) THEN
SET netcom = "ruptime"
SHELL netcom
EXIT
ELSE IF ( v_com == "ty" ) THEN
SET fn=" "+v_d1+v_f1+"'"
SET netcom = rem_cmnd + " " + v_n1 + " '"+vcom+ fn
SHELL netcom
EXIT
ELSE
ERROR "%VNET-W-IVCOMM, Invalid command. "
ENDIF